package maze

var mazeMap = [][]int{
	[]int{0, 0, 1, 1, 1, 1, 1, 1, 1, 1},
	[]int{1, 0, 0, 1, 0, 0, 0, 1, 0, 1},
	[]int{1, 0, 0, 1, 0, 0, 0, 1, 0, 1},
	[]int{1, 0, 0, 0, 0, 1, 1, 0, 0, 1},
	[]int{1, 1, 0, 1, 1, 0, 0, 0, 0, 1},
	[]int{1, 0, 0, 0, 1, 0, 0, 0, 0, 1},
	[]int{1, 0, 1, 0, 0, 0, 1, 0, 0, 1},
	[]int{1, 0, 1, 1, 1, 0, 1, 1, 0, 1},
	[]int{1, 1, 0, 0, 0, 0, 0, 0, 0, 1},
	[]int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}

type Point struct {
	X int
	Y int
}

func (p Point) Equals(tp Point) bool {
	return p.X == tp.X && p.Y == tp.Y
}
func UpPoint(p Point) (np Point) {
	np.X = p.X - 1
	np.Y = p.Y
	return np
}
func RightPoint(p Point) (np Point) {
	np.X = p.X
	np.Y = p.Y + 1
	return np
}
func DownPoint(p Point) (np Point) {
	np.X = p.X + 1
	np.Y = p.Y
	return np
}
func LeftPoint(p Point) (np Point) {
	np.X = p.X
	np.Y = p.Y - 1
	return np
}

type Node struct {
	FromIndex int
	Point     Point
}
var Dirs = []func(Point) Point{
	DownPoint,
	RightPoint,
	UpPoint,
	LeftPoint,
}